<template>
  <a-page-header>
    <a-card>
      <div class="table-page-search-wrapper">
      <a-button type="primary" ghost  @click="backPage()">返回</a-button>

      <a-row style="margin-top: 1px">

        <a-col :offset="2" :span="20">
          <video
              style="margin: 0 auto"
              :src="video"
              controls
              width="80%"
              height="45%"
              :poster="img"
              preload="metadata"
          >
          </video>
        </a-col>

      </a-row>
      </div>
    </a-card>
  </a-page-header>
</template>

<script>

import {getJwtToken} from "@/lib/utils/TokenUtil";

export default {
  mounted() {
    let token = getJwtToken()
    console.log(token)
    let item = sessionStorage.getItem('path');
    console.log(item);
    if (item===''||item===null){
      // this.video = "http://192.168.0.104:8080/play/video?path=RTpcMElubmVyU2lzdGVyUm9vbVwwLjBcMjAyMC4wNFxb5qGc6YO95a2X5bmV57uEXVsyMDA0MDNdW+OBsOOBq+OBg+OBhuOBie+9nuOBi++9nl1PVkHlt6jkubPjg5fjg6rjg7PjgrvjgrnlgqznnKAg77yDMVxb5qGc6YO95a2X5bmV57uEXVsyMDA0MDNdWzcyMFBdW0JJRzVdW+OBsOOBq+OBg+OBhuOBie+9nuOBi++9nl1PVkHlt6jkubPjg5fjg6rjg7PjgrvjgrnlgqznnKAg77yDMS5tcDQ=&token="+getJwtToken()
      this.video = "http://192.168.0.104:8080/play/video"
    }else {
      this.video =`http://192.168.0.104:8080/play/video?path=${item}&token=${token}`
    }

  },
  name: "VideoPlay",
  data(){
    return{
      video:'',
      img:'http://192.168.0.104:8080/acg/0.0/2.png'
    }
  },
  methods:{
    backPage(){
      this.$router.back();
    }
  }
}
</script>

<style scoped>

</style>
